<?php
$table = \Phpcmf\Service::M()->prefix.'attachment';
if (\Phpcmf\Service::M()->db->fieldExists('parent_id', $table)) {
    \Phpcmf\Service::M()->query('ALTER TABLE `'.$table.'` DROP `parent_id`;');
}

$table = \Phpcmf\Service::M()->prefix.'attachment_folder';
if (\Phpcmf\Service::M()->db->tableExists($table)) {
    \Phpcmf\Service::M()->query('DROP TABLE  IF EXISTS`'.$table.'`;');
}


\Phpcmf\Service::M('cache')->sync_cache('');